#ifndef UHM_MAT_EXTENSION_CHOL_INCPIV_HXX_
#define UHM_MAT_EXTENSION_CHOL_INCPIV_HXX_

namespace uhm {
  
  // Basic CHOL incpiv...
  template<class A_, class B_>
  class CHOL_incpiv_ : public CHOL_piv_<A_,B_> {
  private:
  protected:
  public:

    CHOL_incpiv_() : CHOL_piv_<A_,B_>() { }
    CHOL_incpiv_(Int_ type, Int_ uplo, Int_ sym,
                 Int_ mt, Int_ mb,
                 Int_ rhs, Int_ blk) 
      : CHOL_piv_<A_,B_>(type, mt, mb, rhs, blk) { }
    CHOL_incpiv_(Int_ type, 
                 Int_ mt, Int_ mb, 
                 Int_ rhs, 
                 Int_ blk)  
      : CHOL_piv_<A_,B_>(type, mt, mb, rhs, blk) { }
    
    CHOL_incpiv_(const CHOL_incpiv_ &b) : CHOL_piv_<A_,B_>(b) { }

    using CHOL_piv_<A_,B_>::get_leading_flop;	  

    using CHOL_piv_<A_,B_>::update;
    using CHOL_piv_<A_,B_>::decompose;
    using CHOL_piv_<A_,B_>::solve_1_x;
    using CHOL_piv_<A_,B_>::solve_2_x;
    using CHOL_piv_<A_,B_>::solve_1_r;
    using CHOL_piv_<A_,B_>::solve_2_r;
    
    virtual Int_ decompose() {
      if (this->get_mt()) 
        chol_incpiv( Mat_Base_::LOWER_TRIANGULAR, this->_ATL, this->_P );

      this->update();

      return true;
    }
  };

}

#endif
